#openQ_fairness

all_codings <- readRDS("data/all_codings.RDS")

fair <- all_codings %>%
  filter(na_recoded %!in% 1) %>%
  mutate(consensus = ifelse(coder1_fair+coder2_fair+coder3_fair != 1,1,0))

sum(fair$consensus)/nrow(fair)
#90,4% consensus about fair

#check
fair <- fair %>%
  mutate(fair_check = coder1_fair+coder2_fair+coder3_fair)
table(fair$fair_check)
#there are 7 cases where all three coders coded fair. So far we did not count them as matching.
#we coded "1 or 0" so far vs. "not 1" now
#If we do the number changes to 90,5% instead of 90,4%.

fair_es_pl <- all_codings %>%
  filter(na_recoded %!in% 1) %>%
  filter(country %in% c("es", "pl"))
sum(fair_es_pl$fair_recoded)/nrow(fair_es_pl)
#13,0% fair in survey 1

fair_gb <- all_codings %>%
  filter(na_recoded %!in% 1) %>%
  filter(country %in% c("gb"))

sum(fair_gb$fair_recoded)/nrow(fair_gb)
#18,4% fair in survey 2

fair_total <- all_codings %>%
  filter(na_recoded %!in% 1)

sum(fair_total$fair_recoded)/nrow(fair_total)
